﻿@model CNav.Model.UserProfileModel

@{
    ViewBag.Title = "Add new user";
}

@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true)

    <div id="userProfileAccordion">
        <ol>
            <li>
                @Html.LabelFor(m => m.Title)
                @Html.DropDownListFor(model => model.Title, new SelectList(Model.TitleList))
                <br />
                @Html.ValidationMessageFor(model => model.Title)
            </li>

            <li>
                @Html.LabelFor(m => m.FirstName)
                @Html.TextBoxFor(model => model.FirstName)
                <br />
                @Html.ValidationMessageFor(model => model.FirstName)
            </li>

            <li>
                @Html.LabelFor(m => m.Lastname)
                @Html.TextBoxFor(model => model.Lastname)
                <br />
                @Html.ValidationMessageFor(model => model.Lastname)
            </li>
            <li>
                @Html.LabelFor(m => m.Email)
                @Html.TextBoxFor(model => model.Email)
                <br />
                @Html.ValidationMessageFor(model => model.Email)
            </li>
            <li>
                @Html.LabelFor(m => m.UserPosition)
                @Html.TextBoxFor(model => model.UserPosition)
                <br />
                @Html.ValidationMessageFor(model => model.UserPosition)
            </li>
            <li>
                @Html.LabelFor(m => m.PhoneNumber)
                @Html.TextBoxFor(model => model.PhoneNumber)
                <br />
                @Html.ValidationMessageFor(model => model.PhoneNumber)
            </li>

            <li>
                @Html.LabelFor(m => m.FaxNumber)
                @Html.TextBoxFor(model => model.FaxNumber)
                <br />
                @Html.ValidationMessageFor(model => model.FaxNumber)
            </li>

            <li>
                @Html.LabelFor(m => m.AccountExpireDate)
                @Html.TextBoxFor(model => model.AccountExpireDate, Model.AccountExpireDate.ToShortDateString())
                <br />
                @Html.ValidationMessageFor(model => model.AccountExpireDate)
            </li>
            <li>
               <label>&nbsp;</label> <input type="submit" value="Create" />
                <input type="button" value="Cancel" id="cancelButton" />
            </li>

        </ol>
    </div>
}

<script type="text/javascript">
    $(document).ready(function () {

        var cc = new CaseCentre();
        cc.BindCancel('#cancelButton', '@Url.Content("~/UserProfile/")');
        cc.Datepicker("#AccountExpireDate");
    });
</script>
